<script type="text/javascript" src="script/Validator.js"></script>
<div class="path">
    <div>
    	<{if $cg_u_type==1}>
    		<a href="main.php?cg_u_type=1">我的商城</a> <span>&gt;</span>
        <{else}>
    		<a href="main.php?cg_u_type=2">卖家中心</a> <span>&gt;</span>
        <{/if}>
        账户充值 
    </div>
</div>
<div class="main">
	<div class="wrap">
        <div class="hd">
            <ul class="tabs">
                <li class="active"><a href="main.php?m=payment&s=admin_accounts_pay">账户充值</a></li>
            </ul>
        </div>
        <div class="form-style">
            <form target="_blank" action="" method="post" onSubmit="return Validator.Validate(this,3)">
            <input type="hidden" value="add" name="submit">
            <dl>
                <dt><em>*</em>支付方式：</dt>
                <dd>
                <ul class="paymemt clearfix">
                <{foreach item=list from=$re}>
                    <{if $list.payment_type!='account' and $list.payment_type!='cod'}>
                        <li>
                            <img align="top" title="<{$list.payment_name}>" alt="<{$list.payment_name}>" data-param="{'id':'<{$list.payment_type}>'}" src="image/payment/<{$list.payment_type}>.gif" /><i></i>
                        </li>
                    <{/if}>
                <{/foreach}>   
                </ul>
                <input type="hidden" name="payment_type" id="payment_type" value="" dataType="Require" msg="请选择支付方式"/>
                </dd>
            </dl>
            
            <dl class="d1">
                <dt><em>*</em>充值金额：</dt>
                <dd><input type="text" name="amount" id="amount" value="<{$smarty.get.price}>" class="w50" autocomplete="off" dataType="Double" msg="请填写充值金额"> 元</dd>
            </dl>
            
            <dl class="d2 hidden">
                <dt><em>*</em>充值卡帐号：</dt>
                <dd><input type="text" name="card_num" id="card_num" class="w200" autocomplete="off" dataType="" msg="请填写充值金额"></dd>
            </dl>
            <dl class="d2 hidden">
                <dt><em>*</em>充值卡密码：</dt>
                <dd><input type="password" name="password" id="password" class="w200 text" autocomplete="off" dataType="" msg="请填写充值金额"></dd>
            </dl>
            
            <dl class="foot">
                <dt>&nbsp;</dt>
                <dd><input type="submit" value="提交" class="submit"></dd>
            </dl>
            </form>
        </div>
     </div>   
</div>
<script>
$(".paymemt li").bind("click",function(){
	var data = $(this).children('img').attr('data-param');
	eval("data = "+data);
	$("#payment_type").val(data.id);
	if(data.id=='cards')
	{
		$("#amount").attr("dataType","");
		$("#card_num").attr("dataType","Require");
		$("#password").attr("dataType","Require");
		$(".d2").removeClass("hidden").siblings(".d1").addClass("hidden");
	}
	else
	{
		$("#amount").attr("dataType","Double");
		$("#card_num").attr("dataType","");
		$("#password").attr("dataType","");
		$(".d2").addClass("hidden").siblings(".d1").removeClass("hidden");
	}
	$(this).addClass("checked").siblings().removeClass("checked");
});
</script>

